Skip to content

build: fix standalone release checks failing due to missing global ReleaseAction instance #24509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

devversion
Copy link
Member

@devversion devversion commented Mar 2, 2022

Fixes the standalone release checks running outside of the .ng-dev config load (which
comes with the global.ReleaseAction). In standalone checks this variable is not
defined and therefore currently causes errors like:

/.ng-dev/release.ts:14
const actionProto = (global as any).ReleaseAction.prototype;
                                                  ^
TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous>

We can fallback to the imported ReleaseAction constructor object if the global reference
is not provided. In such cases the monkey-patching is a noop anyway.

…eleaseAction` instance

Fixes the standalone release checks running outside of the `.ng-dev` config load, which
comes with the `global.ReleaseAction`. In standalone checks this variable is not
defined and therefore currently causes errors like:

```
/.ng-dev/release.ts:14
const actionProto = (global as any).ReleaseAction.prototype;
                                                  ^
TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous>
```

We can fallback to the imported `ReleaseAction` constructor object if the global reference
is not provided. In such cases the monkey-patching is a noop anyway.
@devversion devversion requested a review from a team as a code owner March 2, 2022 21:51
@devversion devversion added merge safe target: patch This PR is targeted for the next patch release labels Mar 2, 2022
@amysorto amysorto added the action: merge The PR is ready for merge by the caretaker label Mar 2, 2022
@amysorto amysorto merged commit 55549cc into angular:master Mar 2, 2022
amysorto pushed a commit that referenced this pull request Mar 2, 2022
…eleaseAction` instance (#24509)

Fixes the standalone release checks running outside of the `.ng-dev` config load, which
comes with the `global.ReleaseAction`. In standalone checks this variable is not
defined and therefore currently causes errors like:

```
/.ng-dev/release.ts:14
const actionProto = (global as any).ReleaseAction.prototype;
                                                  ^
TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous>
```

We can fallback to the imported `ReleaseAction` constructor object if the global reference
is not provided. In such cases the monkey-patching is a noop anyway.

(cherry picked from commit 55549cc)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants